import request from '@/axios/request';
import url from '@/axios/url';
const { mesUrl, adminUrl } = url();
// 导出url
export const exportUrl = `${mesUrl}wmsOutTaskDetail/export`
// 获取子表详情
export function getInfo(id = '') {
  return request({
    url: `${mesUrl}wmsOutTaskDetail/info/${id}`,
    method: 'get'
  })
}
// 获取主表详情
export function getMasterInfo(id = '') {
  return request({
    url: `${mesUrl}wmsOutTask/info/${id}`,
    method: 'get'
  })
}
//分页查询
export function getList(params = {}) {
  return request({
    url: `${mesUrl}wmsOutTaskDetail`,
    method: 'get',
    params,
  });
}
//新增
export function rowCreate(data = {}) {
  return request({
    url: `${mesUrl}wmsOutTaskDetail`,
    method: 'post',
    data,
  });
}
//修改
export function rowUpdate(data = {}) {
  return request({
    url: `${mesUrl}wmsOutTaskDetail`,
    method: 'put',
    data,
  });
}
//删除
export function rowDel(id) {
  return request({
    url: `${mesUrl}wmsOutTaskDetail/${id}`,
    method: 'put',
  });
}

// 查询库区编码列表
export function getAreaCodeList(params = {}) {
  return request({
    url: `${adminUrl}baseArea/list`,
    method: 'get',
    params,
  });
}
// 查询单据类型 10领料出库20采购退货出库30销售出库40其它出库列表
export function getOrderTypeList() {
  return request({
    url: `${adminUrl}dict/type/wms_out_order_type`,
    method: 'get',
  });
}
// 查询过账状态 10:未过账 20:过账失败 30:过账成功列表
export function getAccountingFlagList() {
  return request({
    url: `${adminUrl}dict/type/wms_accounting_flag`,
    method: 'get',
  });
}

// 获取仓库信息
export function getCurrentWarehouseCode() {
  return request({
    url: `${adminUrl}basic`,
    method: 'get',
  });
}

// 查询库位列表
export function getLocationCodeList(params = {}) {
  return request({
    url: `${adminUrl}baseLocation/list`,
    method: "get",
    params,
  });
}

// 取消合单
export function cancelMerge(data = {}) {
  return request({
    url: `${mesUrl}wmsOutTaskDetail/cancelMerge`,
    method: "post",
    data,
  });
}
// 加入合单计划
export function mergeOrderDetail(data = {}) {
  return request({
    url: `${mesUrl}wmsOutTaskDetail/mergeOrderDetail`,
    method: "post",
    data,
  });
}

// 打印
export function printOrderInfo(data = {}) {
  return request({
    url: `${mesUrl}wmsOutTaskDetail/printOrderInfo`,
    method: "post",
    data,
  });
}


// 获取车间列表
export function getWorkshopList() {
  return request({
    url: `${adminUrl}baseFactoryModeling/getWorkShopListNoPage`,
    method: "GET",
  });
}
